//
//  LDTransitableTableVC.m
//  HDTransitonDemo
//
//  Created by mac on 2017/5/19.
//  Copyright © 2017年 mac. All rights reserved.
//

#import "LDTransitableTableVC.h"
#import "DemoTransitionViewController.h"
#define CellReuseIdentifier @"CellReuseIdentifier"
@interface LDTransitableTableVC ()

@property (nonatomic,strong)NSArray *demos;

@end

@implementation LDTransitableTableVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"系统转场动画";
    [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:CellReuseIdentifier];
    
    _demos = @[
               @"Fade",
               @"Push",
               @"MoveIn",
               @"Reveal",
               @"Cube",
               @"Flip",
               @"SuckEffect",
               @"RippleEffect",
               @"PageCurl",
               @"PageUnCurl",
               @"CameraIrilHollowOpen",
               @"CameraIrisHollowClose",
               ];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    return _demos.count;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellReuseIdentifier forIndexPath:indexPath];
    
    cell.textLabel.text = _demos[indexPath.row];
    
    return cell;
}


- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    DemoTransitionViewController *demoVC = [[DemoTransitionViewController alloc] init];
    demoVC.demoType = indexPath.row;
    demoVC.navigationItem.title = _demos[indexPath.row];
    [self.navigationController pushViewController:demoVC animated:YES];
}


@end
